<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/line/Line.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/demo/line/Line.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'Line_Id',
            footer: "Foots",
            cnName: '线路管理表',
            name: 'line/Line',
            url: "/basicinformation/api/Line/",
            sortName: "Line_Id"
        });
        const editFormFields = ref({ "Line_Name": "", "Start_AddrId": [], "Line_StartAddress": "", "End_AddrId": [], "Line_EndAddress": "", "Line_IfOutsource": "", "ShipperName": "", "ShipperTel": "", "ShipperUnit": "", "Remark": "" });
        const editFormOptions = ref([[{ "title": "路线名称", "required": true, "field": "Line_Name", "type": "text" }],
        [{ "dataKey": "起点终点级联", "data": [], "title": "起点地址", "required": true, "field": "Start_AddrId", "type": "cascader" }],
        [{ "title": "起点详细地址", "required": true, "field": "Line_StartAddress", "type": "text" }],
        [{ "dataKey": "起点终点级联", "data": [], "title": "终点地址", "required": true, "field": "End_AddrId", "type": "cascader" }],
        [{ "title": "终点详细地址", "required": true, "field": "Line_EndAddress", "type": "text" }],
        [{ "dataKey": "是否外协", "data": [], "title": "是否外协", "required": true, "field": "Line_IfOutsource", "type": "select" }],
        [{ "dataKey": "货主姓名下拉框", "data": [], "title": "货主姓名", "required": true, "field": "ShipperName", "type": "select" }],
        [{ "dataKey": "货主手机号", "data": [], "title": "货主手机号", "required": true, "field": "ShipperTel", "type": "select" }],
        [{ "dataKey": "货主单位下拉框", "data": [], "title": "货主单位", "required": true, "field": "ShipperUnit", "type": "select" }],
        [{ "title": "备注", "required": true, "field": "Remark", "type": "textarea" }]]);
        const searchFormFields = ref({ "Line_Name": "", "Start_AddrId": [], "End_AddrId": [], "Line_IfOutsource": "", "ShipperTel": "", "ShipperUnit": "" });
        const searchFormOptions = ref([[{ "title": "路线名称", "field": "Line_Name", "type": "like" }, { "dataKey": "起点终点级联", "data": [], "title": "起点地址", "field": "Start_AddrId", "type": "cascader" }, { "dataKey": "起点终点级联", "data": [], "title": "终点地址", "field": "End_AddrId", "type": "cascader" }], [{ "dataKey": "是否外协", "data": [], "title": "是否外协", "field": "Line_IfOutsource", "type": "select" }, { "dataKey": "货主手机号", "data": [], "title": "货主手机号", "field": "ShipperTel", "type": "like" }, { "dataKey": "货主单位下拉框", "data": [], "title": "货主单位", "field": "ShipperUnit", "type": "like" }]]);
        const columns = ref([{ field: 'Line_Id', title: '主键ID', type: 'string', width: 120, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'Line_Name', title: '路线名称', type: 'string', width: 120, require: true, align: 'left', sort: true },
        { field: 'Start_AddrId', title: '起点地址', type: 'int', bind: { key: '起点终点级联', data: [] }, width: 120, require: true, align: 'left' },
        { field: 'Line_StartAddress', title: '起点详细地址', type: 'string', width: 120, require: true, align: 'left' },
        { field: 'End_AddrId', title: '终点地址', type: 'int', bind: { key: '起点终点级联', data: [] }, width: 120, require: true, align: 'left' },
        { field: 'Line_EndAddress', title: '终点详细地址', type: 'string', width: 120, require: true, align: 'left' },
        { field: 'Line_IfOutsource', title: '是否外协', type: 'int', bind: { key: '是否外协', data: [] }, width: 120, require: true, align: 'left' },
        { field: 'ShipperName', title: '货主姓名', type: 'string', bind: { key: '货主姓名下拉框', data: [] }, width: 120, require: true, align: 'left' },
        { field: 'ShipperTel', title: '货主手机号', type: 'string', bind: { key: '货主手机号', data: [] }, width: 120, require: true, align: 'left' },
        { field: 'ShipperUnit', title: '货主单位', type: 'string', bind: { key: '货主单位下拉框', data: [] }, width: 120, require: true, align: 'left' },
        { field: 'Remark', title: '备注', type: 'string', width: 120, require: true, align: 'left' },
        { field: 'Created_At', title: '记录创建时间', type: 'datetime', width: 120, align: 'left', sort: true },
        { field: 'Updated_At', title: '记录最后更新时间', type: 'datetime', width: 120, align: 'left', sort: true },
        { field: 'CreatedName', title: '记录创建者', type: 'string', width: 120, align: 'left' },
        { field: 'UpdatedName', title: '记录最后更新者', type: 'string', width: 120, align: 'left' },
        { field: 'Is_Deleted', title: '逻辑删除标志, 0表示未删除，1表示已删除', type: 'int', width: 120, hidden: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
